<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>上门取件信息</title>
	</head>
	
    <body>
	   <div class="col-md-12">
	      <!-- BEGIN EXAMPLE TABLE PORTLET-->
	      <div class="portlet">
	      	 <div class="table-toolbar">
			    		<div class="portlet-body form">
				    		<s:form id="queryFrm" action="list" namespace="/admin/pickup" method="post" cssClass="form-horizontal">
								<s:hidden id="_page" name="page" />
					        </s:form>
			    		</div>
		             </div> 
	         <div class="portlet-title">
	            <div class="caption"><i class="icon-edit"></i>需上门取件列表</div>
	         </div>
	         <div class="portlet-body">
	          <div class="clear"></div>
	            <s:if test="%{pickups.size >0}">
	            <table class="table table-striped table-hover table-bordered" id="floorTable">
	               <thead>
	                  <tr>
	                     <th width="180px">送件人</th>
	                     <th width="180px">电话</th>
	                     <th width="180px">时间</th>
                         <th>地址</th>
                         <th width="80px">编辑</th>
	                  </tr>
	               </thead>
	               <tbody>
	               <s:iterator value="pickups" >
	                  <tr >
	                  	
                         <td><s:property value="name" /></td>
                         <td><s:property value="phone" /></td>
                         <td><s:property value="time" /></td>
                         <td><s:property value="address" /></td>
                         <td>
                         	<s:if test="!status">
                         	<a class="edit label label-danger" id="pickup_<s:property value="entityId" />" href="javascript:" onclick="pickuped(<s:property value="entityId" />)" >取件</a>
                         	</s:if>
                         	
                        </td>
                         	
	                  </tr>
	                  </s:iterator>
	               </tbody>
	            </table>
	            
	            <s:include value="/WEB-INF/jsp/admin/paging-bar.jsp" />
	            </s:if><s:else>
	            <s:include value="/WEB-INF/jsp/admin/empty-record.jsp" >
	            	<s:param name="moduleTitle">上门取件信息</s:param>
	            </s:include>
	            </s:else>
	         </div>
	      </div>
	      <!-- END EXAMPLE TABLE PORTLET-->
	   </div>
	<script type="text/javascript">
	function pickuped(id) {
		ajaxPost('<s:url action="pickuped" namespace="/admin/pickup" />',
				{"id": id},
				function(response){
					var status = response.status;
					if(status == 200) {
						$("#pickup_" + id).hide();
					}
				}
			);
	}
	</script>
</body>
</html>